import React from 'react';



class Audio extends React.Component{
    constructor(props) {
        super(props)
        console.log(props)
    }
    componentDidMount() {
    }
    play() {
        this.refs.audio.play().catch(error => {
            // 当播放异常时，走异常流程
            this.play()
        })
    }
    pause() {
        this.refs.audio.pause()
    }
    audiotimeupdate() {
        let curTime = this.refs.currentTime;
    }
    
    setValue(e) {
        this.refs.audio.currentTime = e;
    }
    render() {
        return (
            <React.Fragment>
                {/* <audio ref="audio" onTimeUpdate={() => {this.audiotimeupdate()}}></audio> */}
                <span>{this.props.count}</span>
                <span onClick={() => {this.props.countAdd()}}>+</span>
                <span onClick={() => {this.props.countSub()}}>-</span>
            </React.Fragment>
        )
    }
}
// Audio.propTypes = {
//     src: PropTypes.string
// };


export default Audio;